<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>流氓广告</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .wrapper {
            height: 3000px;
        }

        #box1 {
            width: 200px;
            height: 200px;
            background-color: gold;
        }

        #box2 {
            width: 30px;
            height: 30px;
            background-color: chartreuse;
            text-align: center;
            line-height: 30px;
            cursor: pointer;
        }

        .show {
            position: fixed;
            bottom: 100px;
            right: 0;
        }

    </style>
</head>

<body>
<div class="wrapper">
    <div id="box1">
        <div id="box2">X</div>
        我是流氓广告
    </div>
</div>
<script>
    var box2 = document.getElementById("box2");
    var box1 = document.getElementById("box1");
    console.log(box2.innerText);
    box2.onclick = function () {
        box1.style.display = "none";
        setTimeout(function () {
            box1.style.display = "block";
            box1.className = "show"
        }, 1000)
    }

</script>
</body>

</html>